package nsd.test.zy02;

public class HourlyEmployee extends ColaEmployee {
    private double hourSalary;
    private int hour;

    public HourlyEmployee(String name, int month,double hourSalary, int hour) {
        super(name, month);
        this.hourSalary = hourSalary;
        this.hour = hour;
    }

    @Override
    public double getSalary(int month){
        if(super.getMouth()==month) {
            if (hour > 160) {
                return hourSalary*160+hourSalary*(hour-160)*1.5+100;
            }else {
                return hour*hourSalary+100;
            }
        }else {
            if (hour > 160) {
                return hourSalary*160+hourSalary*(hour-160)*1.5;
            }else {
                return hour*hourSalary;
            }
        }
    }
}
